import Vue from 'vue'
import App from './app.vue'
import VueRouter from 'vue-router'
import routes from './router/router'
import Vuex from 'vuex'
import createLogger from 'vuex/dist/logger'
import stores from './vuex/store'
import Rem from './static/js/rem'

//import $ from 'jquery'
import VueResource from 'vue-resource';
import Fastclick from 'fastclick';

import MintUI from 'mint-ui';
import 'mint-ui/lib/style.css';

Vue.use(MintUI);
Vue.use(VueResource);
Vue.use(VueRouter)
Vue.use(Vuex)
//消除移动端点透和300毫秒延迟
Fastclick.attach(document.body);
//移动端自适应
Rem.rem();
const router = new VueRouter({
  mode: 'hash',
  routes: routes
})
const logger = createLogger({
  collapsed: false,
  transformer(state){
    return state
  },
  mutationTransformer(mutation){
    return mutation.type
  }
})

const store = new Vuex.Store({
    ...stores,
    plugins: process.env.NODE_ENV == "production" ? [] : [logger]
  })
console.log("判断测试还是开发",process.env.NODE_ENV)
//路由的钩子函数
router.afterEach((to, from, next) => {
  document.title = to.meta.title;
})
/* eslint-disable no-new */
const app = new Vue({
  store,
  router: router,
  render: h => h(App)
}).$mount('#app')
